<html>
<head><meta charset="utf-8"><title>Value mangling for integral primitive data types · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html">Value mangling for integral primitive data types</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211996005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/211996005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#211996005">(Oct 02 2020 at 01:39)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>: how reasonable is it going to be to add value mangling for <code>i8</code>through to <code>i128</code>, <code>char</code>, <code>bool</code>, <code>isize</code> (cc <a href="https://github.com/rust-lang/rust/issues/61486">#61486</a>), which are the types we're supporting for <code>min_const_generics</code> that I believe aren't currently supported manglable types? I'm hoping that, because there's still no need to represent arbitrary trees, this should be straightforward?</p>



<a name="212044581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212044581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212044581">(Oct 02 2020 at 08:10)</a>:</h4>
<p>I haven't looked too much into <a href="https://github.com/rust-lang/rust/issues/61486">#61486</a>, but can't we just use <code>usize</code> mangling for all of the <code>min_const_generics</code> types</p>



<a name="212044634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212044634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212044634">(Oct 02 2020 at 08:11)</a>:</h4>
<p>so for <code>fn test&lt;const N: i8&gt;()</code> we encode <code>test::&lt;{ - 1 }&gt;()</code> as <code>test&lt;255&gt;</code> instead</p>



<a name="212074897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212074897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212074897">(Oct 02 2020 at 13:36)</a>:</h4>
<p>I should think that would work, but I imagine <span class="user-mention" data-user-id="119009">@eddyb</span> has thoughts on whether or not that's the preferred approach.</p>



<a name="212075915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212075915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212075915">(Oct 02 2020 at 13:44)</a>:</h4>
<p>I suppose my real question is about the design aspect.</p>



<a name="212076512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212076512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212076512">(Oct 02 2020 at 13:48)</a>:</h4>
<p>fwiw I just posted <a href="https://github.com/rust-lang/rust/pull/77452">https://github.com/rust-lang/rust/pull/77452</a> which adds bool to v0 mangling</p>



<a name="212093766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212093766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212093766">(Oct 02 2020 at 15:56)</a>:</h4>
<p>you could use something like <code>test&lt;n1&gt;</code></p>



<a name="212129378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129378">(Oct 02 2020 at 21:09)</a>:</h4>
<p>oof</p>



<a name="212129386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129386">(Oct 02 2020 at 21:09)</a>:</h4>
<p>please PM me about stuff like this btw</p>



<a name="212129553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129553">(Oct 02 2020 at 21:11)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> no, we don't want the demangler to have to interpret the data</p>



<a name="212129608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129608">(Oct 02 2020 at 21:12)</a>:</h4>
<p>I believe <span class="user-mention" data-user-id="138448">@cuviper</span>'s suggestion is pretty reasonable</p>



<a name="212129649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129649">(Oct 02 2020 at 21:12)</a>:</h4>
<p>we right now use a hex encoding of the data, so we could use <code>n</code> or <code>m</code> to indicate negative/minus</p>



<a name="212129707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129707">(Oct 02 2020 at 21:13)</a>:</h4>
<p>why did I ask on the PR about <code>rustc-demangle</code>. ofc I won't see anything on the PR :(</p>



<a name="212129763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129763">(Oct 02 2020 at 21:14)</a>:</h4>
<p>for <code>char</code> I <em>think</em> the hex is fine</p>



<a name="212129777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129777">(Oct 02 2020 at 21:14)</a>:</h4>
<p>because it's basically <code>'\U{...}'</code></p>



<a name="212129810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129810">(Oct 02 2020 at 21:14)</a>:</h4>
<p>the hex would be just the unsigned magnitude, right?</p>



<a name="212129813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129813">(Oct 02 2020 at 21:15)</a>:</h4>
<p>(not 2's complement)</p>



<a name="212129824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129824">(Oct 02 2020 at 21:15)</a>:</h4>
<p>correct</p>



<a name="212129828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129828">(Oct 02 2020 at 21:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212129553">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> no, we don't want the demangler to have to interpret the data</p>
</blockquote>
<p>well, it would be just <code>value as ty</code>, so we don't really have to interpret anything here, do we?</p>



<a name="212129840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129840">(Oct 02 2020 at 21:15)</a>:</h4>
<p>it's only <code>isize</code> that has the problem, but it's better to be consistent</p>



<a name="212129868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129868">(Oct 02 2020 at 21:15)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> the demangler doesn't know what target the symbol was for</p>



<a name="212129897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129897">(Oct 02 2020 at 21:15)</a>:</h4>
<p>hence focusing on a human-friendly data model rather than dumping the data</p>



<a name="212129948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212129948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212129948">(Oct 02 2020 at 21:16)</a>:</h4>
<p>what does C++ do for value mangling?</p>



<a name="212130012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130012">(Oct 02 2020 at 21:17)</a>:</h4>
<p>C++ is weird because it supports a full expression AST</p>



<a name="212130036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130036">(Oct 02 2020 at 21:17)</a>:</h4>
<p>ah, now I see. I personally am fine with whatever solution you come up here <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span></p>



<a name="212130202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130202">(Oct 02 2020 at 21:19)</a>:</h4>
<p>ah, I guess Itanium C++ would use <code>ng</code> for unary minus<br>
<a href="https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-operator">https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-operator</a></p>



<a name="212130228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130228">(Oct 02 2020 at 21:19)</a>:</h4>
<p>haha it's an AST right lol</p>



<a name="212130301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130301">(Oct 02 2020 at 21:20)</a>:</h4>
<p><span class="user-mention" data-user-id="138448">@cuviper</span> ah no</p>
<blockquote>
<p>&lt;number&gt; is a pseudo-terminal representing a decimal integer, with a leading 'n' for negative integers.</p>
</blockquote>



<a name="212130308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130308">(Oct 02 2020 at 21:20)</a>:</h4>
<p><a href="https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.number">https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.number</a></p>



<a name="212130316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130316">(Oct 02 2020 at 21:20)</a>:</h4>
<p>so yeah we can use <code>n</code></p>



<a name="212130365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130365">(Oct 02 2020 at 21:21)</a>:</h4>
<div class="codehilite"><pre><span></span><code>    &lt;number&gt; ::= [n] &lt;non-negative decimal integer&gt;
</code></pre></div>



<a name="212130393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130393">(Oct 02 2020 at 21:21)</a>:</h4>
<p>oh, I saw <code>non-negative</code> and missed the <code>[n]</code></p>



<a name="212130428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212130428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212130428">(Oct 02 2020 at 21:22)</a>:</h4>
<p>(and skimmed right over the description)</p>



<a name="212246750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212246750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212246750">(Oct 04 2020 at 23:31)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>: I opened <a href="https://github.com/rust-lang/rust/pull/77554">https://github.com/rust-lang/rust/pull/77554</a> at a starting point.</p>



<a name="212247482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247482">(Oct 04 2020 at 23:52)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> do you want to open a <a href="https://github.com/alexcrichton/rustc-demangle">https://github.com/alexcrichton/rustc-demangle</a> PR?</p>



<a name="212247486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247486">(Oct 04 2020 at 23:52)</a>:</h4>
<p>I'm not sure we have the testing setup to demangle a mangled symbol but we should!</p>



<a name="212247494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247494">(Oct 04 2020 at 23:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212247486">said</a>:</p>
<blockquote>
<p>I'm not sure we have the testing setup to demangle a mangled symbol but we should!</p>
</blockquote>
<p>Ah, okay.</p>



<a name="212247497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247497">(Oct 04 2020 at 23:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212247482">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> do you want to open a <a href="https://github.com/alexcrichton/rustc-demangle">https://github.com/alexcrichton/rustc-demangle</a> PR?</p>
</blockquote>
<p>Yep, will do (though it may wait till tomorrow, as it's getting late now).</p>



<a name="212247498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247498">(Oct 04 2020 at 23:53)</a>:</h4>
<p>nevermind it exists <a href="https://github.com/rust-lang/rust/blob/85fbf49ce0e2274d0acf798f6e703747674feec3/compiler/rustc_symbol_mangling/src/test.rs#L42-L45">https://github.com/rust-lang/rust/blob/85fbf49ce0e2274d0acf798f6e703747674feec3/compiler/rustc_symbol_mangling/src/test.rs#L42-L45</a></p>



<a name="212247501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247501">(Oct 04 2020 at 23:53)</a>:</h4>
<p>(this is <code>#[rustc_symbol_name]</code>)</p>



<a name="212247549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247549">(Oct 04 2020 at 23:54)</a>:</h4>
<p>so you should follow <code>#[rustc_symbol_name]</code> tests and make sure it demangles correctly</p>



<a name="212247564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247564">(Oct 04 2020 at 23:55)</a>:</h4>
<p>When I tried using <code>#[rustc_symbol_name]</code>, I got something like <code>symbol-name(_RNvMCs4fqI2P2rA04_5namesINtB2_2I8KapE3foo)</code>, which doesn't look very demangled.</p>



<a name="212247573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247573">(Oct 04 2020 at 23:55)</a>:</h4>
<p>yupp because <code>rustc-demangle</code> doesn't know about the new stuff yet <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="212247576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247576">(Oct 04 2020 at 23:55)</a>:</h4>
<p>wait no</p>



<a name="212247579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247579">(Oct 04 2020 at 23:55)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> that's just the mangled form</p>



<a name="212247618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247618">(Oct 04 2020 at 23:56)</a>:</h4>
<p>you should see <code>demangling(</code> as well when demangling succeeds</p>



<a name="212247625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247625">(Oct 04 2020 at 23:56)</a>:</h4>
<p>Oh, so if <code>demangling(</code> doesn't appear, it means it failed?</p>



<a name="212247627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247627">(Oct 04 2020 at 23:56)</a>:</h4>
<p>yupp, see my last link</p>



<a name="212247632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247632">(Oct 04 2020 at 23:57)</a>:</h4>
<p>Oh, right.</p>



<a name="212247646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247646">(Oct 04 2020 at 23:57)</a>:</h4>
<p>Is it expected not to be demangled properly until I make the changes to <code>rustc-demangle</code>?</p>



<a name="212247647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247647">(Oct 04 2020 at 23:57)</a>:</h4>
<p>also we should fix this thing so that it uses notes on a <code>struct_span_err</code></p>



<a name="212247650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247650">(Oct 04 2020 at 23:57)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> well, yeah, how could it <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span>?</p>



<a name="212247652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247652">(Oct 04 2020 at 23:57)</a>:</h4>
<p>you're adding syntax it doesn't understand</p>



<a name="212247653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247653">(Oct 04 2020 at 23:57)</a>:</h4>
<p>Just a sanity check :P</p>



<a name="212247698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247698">(Oct 04 2020 at 23:58)</a>:</h4>
<p>Okay, so I should make the <code>rustc-demangle</code> change first.</p>



<a name="212247702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247702">(Oct 04 2020 at 23:58)</a>:</h4>
<p>yeah</p>



<a name="212247704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247704">(Oct 04 2020 at 23:58)</a>:</h4>
<p>Why is <code>rustc-demangle</code> not part of the rust-lang organisation?</p>



<a name="212247705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247705">(Oct 04 2020 at 23:58)</a>:</h4>
<p>Or even rustc?</p>



<a name="212247712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247712">(Oct 04 2020 at 23:59)</a>:</h4>
<p><em>shrug</em> we should ask <span class="user-mention" data-user-id="116015">@Alex Crichton</span> to transfer it I guess</p>



<a name="212247713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247713">(Oct 04 2020 at 23:59)</a>:</h4>
<p>Seems to make sense to have mangling and demangling in the same place.</p>



<a name="212247714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247714">(Oct 04 2020 at 23:59)</a>:</h4>
<p>rustc using it is independent of the project existing at all</p>



<a name="212247716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247716">(Oct 04 2020 at 23:59)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> well, no, <code>rustc-demangle</code> is published on <a href="http://crates.io">crates.io</a></p>



<a name="212247718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247718">(Oct 04 2020 at 23:59)</a>:</h4>
<p>so they can't be in the same crate</p>



<a name="212247720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247720">(Oct 04 2020 at 23:59)</a>:</h4>
<p>Ah, I see</p>



<a name="212247766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247766">(Oct 05 2020 at 00:00)</a>:</h4>
<p>Okay, cool, I'll do all that tomorrow.</p>



<a name="212247772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247772">(Oct 05 2020 at 00:00)</a>:</h4>
<p>anyway you can make sure your changes work by adding an unit test to <code>rustc-demangle</code> itself with several of the new symbols</p>



<a name="212247779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247779">(Oct 05 2020 at 00:00)</a>:</h4>
<p>at the bottom of <code>v0.rs</code></p>



<a name="212247804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247804">(Oct 05 2020 at 00:01)</a>:</h4>
<p>Great, thanks for explaining!</p>



<a name="212247853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247853">(Oct 05 2020 at 00:02)</a>:</h4>
<p><code>min_const_generics</code> seems to be getting pretty close now…</p>



<a name="212247854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247854">(Oct 05 2020 at 00:02)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> btw we should also do something where we change how we encode placeholders</p>



<a name="212247855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247855">(Oct 05 2020 at 00:02)</a>:</h4>
<p>fully <code>p</code> instead of the type followed by <code>p</code></p>



<a name="212247858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247858">(Oct 05 2020 at 00:02)</a>:</h4>
<p>alternatively, <code>p</code> followed by the type</p>



<a name="212247866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247866">(Oct 05 2020 at 00:03)</a>:</h4>
<p>Oh, I saw a <code>NOTE</code> about this, but I didn't pay it close attention.</p>



<a name="212247867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247867">(Oct 05 2020 at 00:03)</a>:</h4>
<p>this is because the type "codes" for consts make more sense to use as "const constructors" rather than literally the type</p>



<a name="212247871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247871">(Oct 05 2020 at 00:03)</a>:</h4>
<p>I can explain this more when you want to get back to this</p>



<a name="212247878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247878">(Oct 05 2020 at 00:03)</a>:</h4>
<p>Is this something relevant to <code>min_const_generics</code>, or just the wider <code>const_generics</code>?</p>



<a name="212247919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247919">(Oct 05 2020 at 00:04)</a>:</h4>
<p>it's relevant to const generics existing :P</p>



<a name="212247924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247924">(Oct 05 2020 at 00:04)</a>:</h4>
<p>In that case, it sounds rather important :P</p>



<a name="212247925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247925">(Oct 05 2020 at 00:04)</a>:</h4>
<p>think, uhh,</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">([();</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="n">FOO</span>: <span class="p">()</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="p">}]);</span><span class="w"></span>
</code></pre></div>



<a name="212247940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247940">(Oct 05 2020 at 00:05)</a>:</h4>
<p>By the way, what <em>is</em> "value mangling"?</p>



<a name="212247941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247941">(Oct 05 2020 at 00:05)</a>:</h4>
<p>symbol mangling for const values</p>



<a name="212247944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247944">(Oct 05 2020 at 00:05)</a>:</h4>
<p>Okay, I'll have to look that up. Thanks :)</p>



<a name="212247945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247945">(Oct 05 2020 at 00:05)</a>:</h4>
<p>like for a function instance like <code>foo::&lt;123&gt;</code></p>



<a name="212247946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247946">(Oct 05 2020 at 00:05)</a>:</h4>
<p>Oh!</p>



<a name="212247949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247949">(Oct 05 2020 at 00:05)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span> well, it's symbol name mangling for const generics</p>



<a name="212247989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247989">(Oct 05 2020 at 00:06)</a>:</h4>
<p>I see; that makes so much more sense than what I thought.</p>



<a name="212247990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247990">(Oct 05 2020 at 00:06)</a>:</h4>
<p>you may be aware of both of those things independently :P</p>



<a name="212247994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212247994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212247994">(Oct 05 2020 at 00:06)</a>:</h4>
<p>people are just using shorthands I guess</p>



<a name="212248049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248049">(Oct 05 2020 at 00:08)</a>:</h4>
<p>what... <a href="https://godbolt.org/z/onYsWY">https://godbolt.org/z/onYsWY</a></p>



<a name="212248055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248055">(Oct 05 2020 at 00:08)</a>:</h4>
<p>why is it demangling <em>like that</em></p>



<a name="212248057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248057">(Oct 05 2020 at 00:08)</a>:</h4>
<p>anyway it's <code>_RNvNkNvNtCsbDqzXfLQacH_7example3Foo1_003FOO</code></p>



<a name="212248069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248069">(Oct 05 2020 at 00:09)</a>:</h4>
<p>oh wow it does demangle as <code>example::Foo::0::FOO</code></p>



<a name="212248071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248071">(Oct 05 2020 at 00:09)</a>:</h4>
<p>that... doesn't seem correct lol</p>



<a name="212248082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248082">(Oct 05 2020 at 00:10)</a>:</h4>
<p><code>1_00</code> is indeed the mangling of the identifier <code>0</code></p>



<a name="212248127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248127">(Oct 05 2020 at 00:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212247925">said</a>:</p>
<blockquote>
<p>think, uhh,</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">([();</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="n">FOO</span>: <span class="p">()</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="p">}]);</span><span class="w"></span>
</code></pre></div>

</blockquote>
<p>What's the issue with this example?</p>



<a name="212248137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248137">(Oct 05 2020 at 00:11)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> I tunnel-vision'd and didn't end up with the correct example <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="212248138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248138">(Oct 05 2020 at 00:11)</a>:</h4>
<p>but now I found a bug</p>



<a name="212248142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248142">(Oct 05 2020 at 00:11)</a>:</h4>
<p>I wonder if <span class="user-mention" data-user-id="281572">@marmeladema</span>'s <a href="https://github.com/rust-lang/rust/issues/76176">#76176</a> introduced it, or if it was something else</p>



<a name="212248200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248200">(Oct 05 2020 at 00:12)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> this is the correct example <a href="https://godbolt.org/z/neMrxf">https://godbolt.org/z/neMrxf</a></p>



<a name="212248204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248204">(Oct 05 2020 at 00:13)</a>:</h4>
<p><code>&lt;example::Foo&lt;_&gt;&gt;::foo::FOO</code></p>



<a name="212248209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248209">(Oct 05 2020 at 00:13)</a>:</h4>
<p>that <code>_</code> is what I'm talking about</p>



<a name="212248211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248211">(Oct 05 2020 at 00:13)</a>:</h4>
<p>it's the <code>jp</code> in <code>_RNvNvMCsbDqzXfLQacH_7exampleINtB4_3FooKjpE3foo3FOO</code></p>



<a name="212248258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248258">(Oct 05 2020 at 00:14)</a>:</h4>
<p>so <code>j</code> is <code>usize</code> and <code>p</code> is <code>_</code></p>



<a name="212248259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248259">(Oct 05 2020 at 00:14)</a>:</h4>
<p>but maybe we want to remove the type from that case</p>



<a name="212248264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248264">(Oct 05 2020 at 00:14)</a>:</h4>
<p>because for more complicated types it doesn't make sense</p>



<a name="212248278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248278">(Oct 05 2020 at 00:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212248264">said</a>:</p>
<blockquote>
<p>because for more complicated types it doesn't make sense</p>
</blockquote>
<p>What's an example where it doesn't make sense?</p>



<a name="212248281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248281">(Oct 05 2020 at 00:15)</a>:</h4>
<p>replace <code>usize</code> with, idk, <code>Range&lt;usize&gt;</code></p>



<a name="212248283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248283">(Oct 05 2020 at 00:16)</a>:</h4>
<p>or <code>(usize, usize)</code> as a better example</p>



<a name="212248329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248329">(Oct 05 2020 at 00:16)</a>:</h4>
<p>we don't want to actually encode the type, <code>TjjE</code></p>



<a name="212248334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248334">(Oct 05 2020 at 00:16)</a>:</h4>
<p>Because it's a waste of space, or because there's actually a problem with it?</p>



<a name="212248337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248337">(Oct 05 2020 at 00:16)</a>:</h4>
<p>Sorry if I'm being slow; it's quite late.</p>



<a name="212248338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248338">(Oct 05 2020 at 00:16)</a>:</h4>
<p>Or why would switching it to <code>p</code> followed by the type be better?</p>



<a name="212248349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248349">(Oct 05 2020 at 00:17)</a>:</h4>
<p>because for fully known values it would be, say, <code>Tj1_j2_E</code> for <code>(1, 2)</code></p>



<a name="212248359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248359">(Oct 05 2020 at 00:17)</a>:</h4>
<p>the "type followed by value" only applies to primitives</p>



<a name="212248366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248366">(Oct 05 2020 at 00:17)</a>:</h4>
<p>so we would be forced to use <code>TjpjpE</code> i.e. <code>(_, _)</code></p>



<a name="212248410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248410">(Oct 05 2020 at 00:18)</a>:</h4>
<p>instead of being able to have a <code>_</code> of an arbitrary type</p>



<a name="212248417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248417">(Oct 05 2020 at 00:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212248359">said</a>:</p>
<blockquote>
<p>the "type followed by value" only applies to primitives</p>
</blockquote>
<p>Oh, I see.</p>



<a name="212248423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248423">(Oct 05 2020 at 00:19)</a>:</h4>
<p>Well, just using <code>p</code> seems reasonable to me.</p>



<a name="212248427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248427">(Oct 05 2020 at 00:19)</a>:</h4>
<p>so the current <code>p</code> for constants breaks down the moment you start thinking about aggregates, is I guess what I should say <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="212248428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248428">(Oct 05 2020 at 00:19)</a>:</h4>
<p>The type information should always be available somewhere anyway.</p>



<a name="212248439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248439">(Oct 05 2020 at 00:19)</a>:</h4>
<p>because const generics are unstable, I think we can switch to it now, before we start going on a stabilization path</p>



<a name="212248486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248486">(Oct 05 2020 at 00:20)</a>:</h4>
<p>and not have to support the old <code>jp</code></p>



<a name="212248488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248488">(Oct 05 2020 at 00:20)</a>:</h4>
<p>Yep, that seems sensible.</p>



<a name="212248493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248493">(Oct 05 2020 at 00:20)</a>:</h4>
<p>I can do that in the <code>Int</code>/<code>char</code> PR as well?</p>



<a name="212248498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248498">(Oct 05 2020 at 00:21)</a>:</h4>
<p>feel free to, since you have to touch <code>rustc-demangle</code> already</p>



<a name="212248501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248501">(Oct 05 2020 at 00:21)</a>:</h4>
<p>why do I always <del>mangle</del> mistype the name of that crate <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="212248555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248555">(Oct 05 2020 at 00:23)</a>:</h4>
<p>hmm so coming back to the bug, this mangles correctly:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="n">FOO</span>: <span class="p">()</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="p">};</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="212248558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248558">(Oct 05 2020 at 00:23)</a>:</h4>
<p>so only anonymous consts are broken?</p>



<a name="212248616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248616">(Oct 05 2020 at 00:25)</a>:</h4>
<p>okay so we shouldn't be showing them, I forgot about that <a href="https://github.com/rust-lang/rust/blob/beb5ae474d2835962ebdf7416bd1c9ad864fe101/compiler/rustc_symbol_mangling/src/v0.rs#L583-L585">https://github.com/rust-lang/rust/blob/beb5ae474d2835962ebdf7416bd1c9ad864fe101/compiler/rustc_symbol_mangling/src/v0.rs#L583-L585</a></p>



<a name="212248713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248713">(Oct 05 2020 at 00:28)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> lmao it's the field</p>



<a name="212248714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248714">(Oct 05 2020 at 00:28)</a>:</h4>
<p><span class="user-mention" data-user-id="281572">@marmeladema</span> sorry for the false alarm</p>



<a name="212248718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248718">(Oct 05 2020 at 00:29)</a>:</h4>
<p><a href="https://godbolt.org/z/bah7nd">https://godbolt.org/z/bah7nd</a></p>



<a name="212248726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248726">(Oct 05 2020 at 00:29)</a>:</h4>
<p>mystery solved</p>



<a name="212248727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248727">(Oct 05 2020 at 00:29)</a>:</h4>
<p>i.e. <code>Foo.0</code>?</p>



<a name="212248729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248729">(Oct 05 2020 at 00:29)</a>:</h4>
<p>yupp!</p>



<a name="212248733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248733">(Oct 05 2020 at 00:29)</a>:</h4>
<p><span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="212248739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248739">(Oct 05 2020 at 00:29)</a>:</h4>
<p>the <code>AnonConst</code> is there but isn't shown (this is intentional)</p>



<a name="212248740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248740">(Oct 05 2020 at 00:30)</a>:</h4>
<p>and I forgot fields existed</p>



<a name="212248800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248800">(Oct 05 2020 at 00:31)</a>:</h4>
<p>It's easily done; they're a fairly obscure language feature.</p>



<a name="212248838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248838">(Oct 05 2020 at 00:32)</a>:</h4>
<p>I just am not yet familiar enough with the mangling scheme to guess what's going on.</p>



<a name="212248841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248841">(Oct 05 2020 at 00:32)</a>:</h4>
<p>Hopefully that will change after I make some changes to <code>rustc-demangle</code> myself.</p>



<a name="212248842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248842">(Oct 05 2020 at 00:32)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> I mean, this is at the <code>DefPath</code> level</p>



<a name="212248845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248845">(Oct 05 2020 at 00:32)</a>:</h4>
<p>if you debug-printed the <code>DefId</code> you'd see the same thing</p>



<a name="212248859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248859">(Oct 05 2020 at 00:33)</a>:</h4>
<p>well, <code>example::Foo::0::{constant#0}::FOO</code>, since we don't hide that <code>AnonConst</code> there</p>



<a name="212248867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248867">(Oct 05 2020 at 00:33)</a>:</h4>
<p>actually, I think there's a way to trick it to do this</p>



<a name="212248908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248908">(Oct 05 2020 at 00:34)</a>:</h4>
<p>this is weird though, I was hoping that attribute to be more useful <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=6a02ad24330c657205d38adc256c77a7">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=6a02ad24330c657205d38adc256c77a7</a></p>



<a name="212248917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248917">(Oct 05 2020 at 00:34)</a>:</h4>
<p>That's true, but it's definitely less confusing to see some indication of the constant, as you say.</p>



<a name="212248919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248919">(Oct 05 2020 at 00:34)</a>:</h4>
<p>oh. oh no</p>



<a name="212248921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248921">(Oct 05 2020 at 00:34)</a>:</h4>
<p>this is that feature to shorten names</p>



<a name="212248928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248928">(Oct 05 2020 at 00:35)</a>:</h4>
<p>can't believe it broke <code>#[rustc_def_path]</code> <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="212248935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248935">(Oct 05 2020 at 00:35)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="244331">@Dan Aloni (da-x)</span></p>



<a name="212248937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248937">(Oct 05 2020 at 00:35)</a>:</h4>
<p>What do you expect <code>rustc_def_path</code> to print in this instance?</p>



<a name="212248941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248941">(Oct 05 2020 at 00:35)</a>:</h4>
<p>the def path</p>



<a name="212248943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248943">(Oct 05 2020 at 00:35)</a>:</h4>
<p>gimme a sec</p>



<a name="212248984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248984">(Oct 05 2020 at 00:36)</a>:</h4>
<p>Hmm, so <code>#[rustc_symbol_name]</code> produces <code>demangling-alt(playground::Foo::field::{{constant}}::FOO)</code>, which is more helpful.</p>



<a name="212248986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248986">(Oct 05 2020 at 00:36)</a>:</h4>
<p><span class="user-mention" data-user-id="244331">@Dan Aloni (da-x)</span> <span class="user-mention" data-user-id="121053">@varkor</span> <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=45fe328fa760e25fbd89bd4d9aec05cc">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=45fe328fa760e25fbd89bd4d9aec05cc</a></p>



<a name="212248995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248995">(Oct 05 2020 at 00:36)</a>:</h4>
<p>the <code>const FOO</code> line shouldn't be necessary</p>



<a name="212248997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212248997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212248997">(Oct 05 2020 at 00:36)</a>:</h4>
<p><code>def-path(Foo::field::{constant#0}::FOO)</code> is the only correct output</p>



<a name="212249019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249019">(Oct 05 2020 at 00:37)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=13bad05c20cc28edcf01919d62c9450b">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=13bad05c20cc28edcf01919d62c9450b</a></p>



<a name="212249024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249024">(Oct 05 2020 at 00:37)</a>:</h4>
<p>this is how I realized what was going on, <del>it was printing <code>def-path(X)</code> :D</del></p>



<a name="212249037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249037">(Oct 05 2020 at 00:38)</a>:</h4>
<p>err, it was printing <code>X</code> in the type error</p>



<a name="212249067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249067">(Oct 05 2020 at 00:38)</a>:</h4>
<p>Ahh</p>



<a name="212249068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249068">(Oct 05 2020 at 00:38)</a>:</h4>
<p>which is fine because there's only one <code>X</code> in the entire crate</p>



<a name="212249075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249075">(Oct 05 2020 at 00:38)</a>:</h4>
<p>but <code>#[rustc_def_path]</code> should print the def path with that feature disabled</p>



<a name="212249084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249084">(Oct 05 2020 at 00:39)</a>:</h4>
<p>(this is only a minor bug, not very important)</p>



<a name="212249087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249087">(Oct 05 2020 at 00:39)</a>:</h4>
<p>like it only makes testing more annoying</p>



<a name="212249096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249096">(Oct 05 2020 at 00:39)</a>:</h4>
<p>This is simply due to the new heuristic for paths in diagnostics?</p>



<a name="212249098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249098">(Oct 05 2020 at 00:40)</a>:</h4>
<p>yeah hence me pinging <span class="user-mention" data-user-id="244331">@Dan Aloni (da-x)</span></p>



<a name="212249148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249148">(Oct 05 2020 at 00:40)</a>:</h4>
<p>anyway yeah <code>Foo::0::{constant#0}::X</code>. the <code>0</code> there is the field <code>.0</code></p>



<a name="212249158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249158">(Oct 05 2020 at 00:40)</a>:</h4>
<p>maybe it should be printed some other way. but also, it's fine. and also this is a rare case</p>



<a name="212249168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249168">(Oct 05 2020 at 00:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212249098">said</a>:</p>
<blockquote>
<p>yeah hence me pinging <span class="user-mention silent" data-user-id="244331">Dan Aloni (da-x)</span></p>
</blockquote>
<p>I've not been so good at keeping up with what's happening and who's doing what recently <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="212249177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249177">(Oct 05 2020 at 00:41)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/73996">#73996</a></p>



<a name="212249181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249181">(Oct 05 2020 at 00:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212249158">said</a>:</p>
<blockquote>
<p>maybe it should be printed some other way. but also, it's fine. and also this is a rare case</p>
</blockquote>
<p>I think with the <code>{constant#0}</code>, this is completely readable.</p>



<a name="212249185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249185">(Oct 05 2020 at 00:41)</a>:</h4>
<p>heh</p>



<a name="212249229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249229">(Oct 05 2020 at 00:42)</a>:</h4>
<p>anyway the symbol doesn't have  that because it would require us to "stabilize" the existence of "anonymous constants" as something that's important to symbols</p>



<a name="212249239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249239">(Oct 05 2020 at 00:43)</a>:</h4>
<p>the only ones we did that to are <code>C</code> (<code>closure</code>) and <code>S</code> (<code>shim</code>)</p>



<a name="212249251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249251">(Oct 05 2020 at 00:43)</a>:</h4>
<p>What's the disadvantage to acknowledging constants' existence?</p>



<a name="212249297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249297">(Oct 05 2020 at 00:44)</a>:</h4>
<p>probably none</p>



<a name="212249309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249309">(Oct 05 2020 at 00:45)</a>:</h4>
<p>the other one is <code>impl Trait</code> (printed as e.g. <code>{opaque#0}</code> by <code>rustc</code> itself)</p>



<a name="212249322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249322">(Oct 05 2020 at 00:45)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> anyway the format is robust to encoding things we don't need to show to the users</p>



<a name="212249377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249377">(Oct 05 2020 at 00:46)</a>:</h4>
<p>Did the rust-demangle GCC patches get accepted in the end, or is that still in limbo?</p>



<a name="212249379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249379">(Oct 05 2020 at 00:46)</a>:</h4>
<p>limbo</p>



<a name="212249385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249385">(Oct 05 2020 at 00:46)</a>:</h4>
<p>one fun thing we could do is we could add macro expansion "nodes" to def paths, and therefore to mangling</p>



<a name="212249395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249395">(Oct 05 2020 at 00:47)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> if you want to implement aggregate value mangling and demangling we can include that in the patch and try again :P</p>



<a name="212249397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249397">(Oct 05 2020 at 00:47)</a>:</h4>
<p>just so we have to upstream less later</p>



<a name="212249401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249401">(Oct 05 2020 at 00:47)</a>:</h4>
<p>I forget what <span class="user-mention" data-user-id="124288">@oli</span> did so far</p>



<a name="212249444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249444">(Oct 05 2020 at 00:48)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> will min const generics not include <code>&amp;str</code>?</p>



<a name="212249447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249447">(Oct 05 2020 at 00:48)</a>:</h4>
<p>because I know people want that one</p>



<a name="212249450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249450">(Oct 05 2020 at 00:48)</a>:</h4>
<p>That would be nice. I definitely think supporting aggregates as a second intermediate step before full const generics would be good (and hopefully straightforward).</p>



<a name="212249453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249453">(Oct 05 2020 at 00:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212249444">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> will min const generics not include <code>&amp;str</code>?</p>
</blockquote>
<p>Nope</p>



<a name="212249454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249454">(Oct 05 2020 at 00:49)</a>:</h4>
<p>awww</p>



<a name="212249462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249462">(Oct 05 2020 at 00:49)</a>:</h4>
<p>There are still some issues with lifetimes in const generics that need to be ironed out first.</p>



<a name="212249463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249463">(Oct 05 2020 at 00:49)</a>:</h4>
<p>thing is, <code>&amp;str</code> is the hardest to support</p>



<a name="212249466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249466">(Oct 05 2020 at 00:49)</a>:</h4>
<p>I'm surprised. can't we require it's <code>&amp;'static str</code>?</p>



<a name="212249476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249476">(Oct 05 2020 at 00:49)</a>:</h4>
<p>I mean, we don't allow parameters anyway</p>



<a name="212249524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249524">(Oct 05 2020 at 00:50)</a>:</h4>
<p>I think there was some problem even then, but I can't quite remember… let me check.</p>



<a name="212249527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249527">(Oct 05 2020 at 00:50)</a>:</h4>
<p>like tuples are easy. you just take the type syntax but put constants inside rather than types</p>



<a name="212249541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249541">(Oct 05 2020 at 00:50)</a>:</h4>
<p>for everything else, you repeat the tuple thing but with other "codes" <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="212249546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249546">(Oct 05 2020 at 00:50)</a>:</h4>
<p>like if tuples are <code>T...E</code>, arrays could be <code>A...E</code></p>



<a name="212249558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249558">(Oct 05 2020 at 00:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types/near/212249524">said</a>:</p>
<blockquote>
<p>I think there was some problem even then, but I can't quite remember… let me check.</p>
</blockquote>
<p>Okay, maybe I was misremembering, or maybe it got fixed since.</p>



<a name="212249561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249561">(Oct 05 2020 at 00:51)</a>:</h4>
<p>references could just be a <code>R</code> prefix</p>



<a name="212249610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249610">(Oct 05 2020 at 00:52)</a>:</h4>
<p>Hmm, maybe there isn't an obstruction to <code>&amp;'static str</code> then…</p>



<a name="212249621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249621">(Oct 05 2020 at 00:52)</a>:</h4>
<p>I think we should try it after <code>min_const_generics</code> is stabilised.</p>



<a name="212249622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249622">(Oct 05 2020 at 00:52)</a>:</h4>
<p>non-primitives are only slightly harder, like tuple structs could just be a combination of the const tuple syntax and the path syntax</p>



<a name="212249636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249636">(Oct 05 2020 at 00:53)</a>:</h4>
<p>(and tuple variants are just tuple structs but the "struct path" is <code>Enum::Variant</code>)</p>



<a name="212249642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249642">(Oct 05 2020 at 00:53)</a>:</h4>
<p>named fields is going to the be most annoying one, and even that shouldn't be too bad</p>



<a name="212249694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249694">(Oct 05 2020 at 00:54)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> but <code>&amp;str</code> is annoying because the type of the data is <code>str</code> not <code>&amp;str</code></p>



<a name="212249700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249700">(Oct 05 2020 at 00:54)</a>:</h4>
<p>You mean for the (de)mangling?</p>



<a name="212249704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249704">(Oct 05 2020 at 00:54)</a>:</h4>
<p>so I <em>think</em> we should encode it in such a way that it would be naively demangled as e.g. <code>foo::&lt;&amp;*"test"&gt;</code></p>



<a name="212249758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249758">(Oct 05 2020 at 00:56)</a>:</h4>
<p>as in, we always mangle the <code>R</code> for reference, and then the <code>str</code> value which is what would be demangled as <code>*"test"</code></p>



<a name="212249761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249761">(Oct 05 2020 at 00:56)</a>:</h4>
<p>and to make it nice we can skip both the <code>&amp;</code> and the <code>*</code> when they would follow eachother like that</p>



<a name="212249765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249765">(Oct 05 2020 at 00:56)</a>:</h4>
<p>we can do something similar for <code>[u8]</code> (i.e. use <code>*b"..."</code> syntax and skip the <code>&amp;*</code> for <code>&amp;[u8]</code>)</p>



<a name="212249769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249769">(Oct 05 2020 at 00:57)</a>:</h4>
<p>I think I'm reinventing stuff I talked to <span class="user-mention" data-user-id="124288">@oli</span> about <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="212249779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249779">(Oct 05 2020 at 00:57)</a>:</h4>
<p>:P</p>



<a name="212249783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249783">(Oct 05 2020 at 00:57)</a>:</h4>
<p>It's nice to be at the point where this is one of the pressing issues.</p>



<a name="212249829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249829">(Oct 05 2020 at 00:58)</a>:</h4>
<p>There are fewer const generics issues remaining than I thought.</p>



<a name="212249830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212249830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212249830">(Oct 05 2020 at 00:58)</a>:</h4>
<p>it should be really easy now that we have <code>const_destructure</code> and <code>const_deref</code> queries <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>



<a name="212269946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212269946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212269946">(Oct 05 2020 at 08:14)</a>:</h4>
<p>I am really trying to elimintate those!</p>



<a name="212337983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212337983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dan Aloni (da-x) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212337983">(Oct 05 2020 at 18:26)</a>:</h4>
<p>For <code>#[rustc_def_path]</code>, something like this should work: </p>
<div class="codehilite"><pre><span></span><code>diff --git a/compiler/rustc_symbol_mangling/src/test.rs b/compiler/rustc_symbol_mangling/src/test.rs
index 24850a8a0d25..0ea6e4d720ff 100644
--- a/compiler/rustc_symbol_mangling/src/test.rs
+++ b/compiler/rustc_symbol_mangling/src/test.rs
@@ -7,6 +7,7 @@
 use rustc_hir as hir;
 use rustc_middle::ty::{Instance, TyCtxt};
 use rustc_span::symbol::{sym, Symbol};
+use rustc_middle::ty::print::with_no_trimmed_paths;

 const SYMBOL_NAME: Symbol = sym::rustc_symbol_name;
 const DEF_PATH: Symbol = sym::rustc_def_path;
@@ -44,7 +45,7 @@ impl SymbolNamesTest&lt;&#39;tcx&gt; {
                     tcx.sess.span_err(attr.span, &amp;format!(&quot;demangling-alt({:#})&quot;, demangling));
                 }
             } else if tcx.sess.check_name(attr, DEF_PATH) {
-                let path = tcx.def_path_str(def_id.to_def_id());
+                let path = with_no_trimmed_paths(|| tcx.def_path_str(def_id.to_def_id()));
                 tcx.sess.span_err(attr.span, &amp;format!(&quot;def-path({})&quot;, path));
             }
</code></pre></div>



<a name="212337994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212337994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dan Aloni (da-x) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212337994">(Oct 05 2020 at 18:26)</a>:</h4>
<p>Should open a PR?</p>



<a name="212346383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212346383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212346383">(Oct 05 2020 at 19:34)</a>:</h4>
<p><span class="user-mention" data-user-id="244331">@Dan Aloni (da-x)</span> An ICE also happens when trying to format a type using <code>{}</code>. Should it just default to <code>with_no_trimmed_paths</code> when it would otherwise ICE.</p>



<a name="212346916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212346916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dan Aloni (da-x) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212346916">(Oct 05 2020 at 19:40)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span>  You mean <a href="https://github.com/rust-lang/rust/issues/77458">#77458</a>? That ICE is by design, and should happen only if no diagnostics were emitted. If there were diagnostics, then that's the bug. Or, if this formatting was not oriented to the user, then should use <code>{:?}</code> instead.</p>



<a name="212356665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212356665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212356665">(Oct 05 2020 at 21:05)</a>:</h4>
<p>It is user facing, just at runtime instead of compile time.</p>



<a name="212502383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212502383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212502383">(Oct 07 2020 at 00:21)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>: opened a PR to add value demangling for the MCG types: <a href="https://github.com/alexcrichton/rustc-demangle/pull/39">https://github.com/alexcrichton/rustc-demangle/pull/39</a></p>



<a name="212502445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212502445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212502445">(Oct 07 2020 at 00:22)</a>:</h4>
<p>I have a PR ready to go to add mangling support to rustc as soon as this is merged.</p>



<a name="212506175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212506175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212506175">(Oct 07 2020 at 01:32)</a>:</h4>
<p>Oh, I forgot to make the placeholder changes. I'll do that tomorrow.</p>



<a name="212595617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212595617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212595617">(Oct 07 2020 at 17:56)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>: here's the PR for changing the placeholder behaviour: <a href="https://github.com/alexcrichton/rustc-demangle/pull/40">https://github.com/alexcrichton/rustc-demangle/pull/40</a></p>



<a name="212614891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Value%20mangling%20for%20integral%20primitive%20data%20types/near/212614891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Value.20mangling.20for.20integral.20primitive.20data.20types.html#212614891">(Oct 07 2020 at 20:27)</a>:</h4>
<p>The rustc PR is now ready for review: <a href="https://github.com/rust-lang/rust/pull/77554">https://github.com/rust-lang/rust/pull/77554</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>